<?php if (!defined('THINK_PATH')) exit();?> <!DOCTYPE html>
<html>
  
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>
      <?php echo $title; ?> - <?php echo C('TITLE'); ?>
    </title>
     <link rel="stylesheet" href="//at.alicdn.com/t/font_mqhl04idhqx8byb9.css">
      <link rel="stylesheet" href="/project/fly/Public/layui/css/layui.css">
      <link rel="stylesheet" href="/project/fly/Public/css/global.css">
       <script src="/project/fly/Public/layui/layui.js">
        </script>
    <script src="/project/fly/Public/js/jquery-3.2.1.min.js">
        </script>
  </head>
  
  <body>
    <div class="header">
      <div class="main">
        <a class="logo" href="<?php echo U('home/index/index');?>" title="Fly">
          仿Fly社区
        </a>
        <div class="nav">
          <a href="<?php echo U('Home/index/all');?>" class="<?php if(in_array(ACTION_NAME, ['all','unsolve','solve','wonder','myquestion']))echo 'nav-this' ?>">
            <i class="iconfont icon-wenda">
            </i>
            讨论
          </a>
          <a href="javascript:;">
            <i class="iconfont icon-iconmingxinganli" style="top: 2px;">
            </i>
            案例
          </a>
          <a href="javascript:;">
            <i class="iconfont icon-ui">
            </i>
            框架
          </a>
        </div>
          <?php if($_SESSION['uid']){ ?>
           <div class="nav-user">
	         <a class="avatar" href="<?php echo U('Home/userCenter/set');?>">
	           <img src='/project/fly/<?php echo $_SESSION['face'] ?>'>
	           <cite>
	             <?php echo $_SESSION['nickname'] ?>
	           </cite>
	         </a>
           <?php if($_SESSION['msg']!=0 && $_SESSION['msg']<=99){ ?>
              <a class="nav-message" href="<?php echo U('home/userCenter/delMsg',['del'=>1]);?>" title="您有<?php echo $_SESSION['msg']; ?>条未阅读的消息"><?php echo $_SESSION['msg']; ?></a>
            <?php }elseif($_SESSION['msg']>99){ ?>
              <a class="nav-message" href="<?php echo U('home/userCenter/delMsg',['del'=>1]);?>" title="您有99+条未阅读的消息"><?php echo '99+'; ?></a>
            <?php } ?>
	         <div class="nav">
	           <a href="<?php echo U('home/userCenter/set');?>">
	             <i class="iconfont icon-shezhi">
	             </i>
	             设置
	           </a>
	           <a href="<?php echo U('home/logOut/index');?>">
	             <i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;">
	             </i>
	             退了
	           </a>
	         </div>
		     </div>
          	<?php }else{ ?>
				<div class="nav-user">
		          <a class="unlogin" href="/user/login/">
		            <i class="iconfont icon-touxiang">
		            </i>
		          </a>
		          <span>
		            <a href="<?php echo U('home/login/index');?>">
		              登入
		            </a>
		            <a href="<?php echo U('home/reg/index');?>">
		              注册
		            </a>
		          </span>
		          <p class="out-login">
		            <a href="http://fly.layui.com/app/qq" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})"
		            class="iconfont icon-qq" title="QQ登入">
		            </a>
		            <a href="http://fly.layui.com/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})"
		            class="iconfont icon-weibo" title="微博登入">
		            </a>
		          </p>
          </div>
          	<?php } ?>
         
      </div>
    </div>



 <div class="main fly-user-main layui-clear">
    <div class="fly-home" style="background-image: url();">
      <img src="/project/fly/<?php echo $user['face'] ?>">
      <h1>
        <?php echo $user['nickname']; ?>
        <?php if($user['sex']=='0'){ ?>
          <i class="iconfont           icon-nan        "></i>
         <?php }else{ ?>
          <i class="iconfont           icon-nv        "></i>
         <?php  } ?>
        
      </h1>
      <p class="fly-home-info">
        <i class="iconfont icon-zuichun" title="飞吻">
        </i>
        <span style="color: #FF7200;">
          <?php echo $user['kiss']; ?>飞吻
        </span>
        <i class="iconfont icon-shijian">
        </i>
        <span>
         <?php  echo Ctime($user['create_time']); ?>
          加入
        </span>
        <i class="iconfont icon-chengshi">
        </i>
        <span>
          来自
          <?php  if(!empty($user['city'])){ echo $user['city']; }else{ echo "某城"; } ?>
        </span>
      </p>
      <p class="fly-home-sign">
        <?php  if(!empty($user['sign'])){ echo $user['sign']; }else{ echo'（这个人懒得留下签名）'; } ?>
      </p>
    </div>
    <div class="main fly-home-main">
      <div class="layui-inline fly-home-jie">
        <div class="fly-panel">
          <h3 class="fly-panel-title">
            <?php echo $user['nickname']; ?> 最近的提问
          </h3>
          <ul class="jie-row">
              <?php if(empty($que)){ ?>
                 <div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;">
                  <span>
                    没有回答任何求解
                  </span>
                </div>
              <?php }else{ ?>
                  <?php foreach ($que as $row): ?>
                    <li>
                      <a href="<?php echo U('home/discuss/index').'?qid='.$row['qid']; ?>" class="jie-title">
                        <?php echo $row['title']; ?>
                      </a>
                      <i>
                        <?php echo Ctime($row['create_time']); ?>
                      </i>
                      <em>
                       <?php echo $row['view_num']; ?>阅/<?php echo $row['answer_num']; ?>答
                      </em>
                    </li>
                  <?php endforeach; ?>
              <?php  } ?>
          </ul>
        </div>
      </div>
      <div class="layui-inline fly-home-da">
        <div class="fly-panel">
          <h3 class="fly-panel-title">
            <?php echo $user['nickname']; ?> 最近的回答
          </h3>
          <ul class="home-jieda">
            <?php if(empty($res)){ ?>
                <div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;">
                  <span>
                    没有回答任何问题
                  </span>
                </div>
            <?php }else{ ?>
                <?php foreach ($res as $row): ?>
                  <li>
                    <p>
                      <span>
                        <?php echo Ctime($row['create_time']); ?>
                      </span>
                      在
                      <a href="<?php echo U('home/discuss/index').'?qid='.$row['qid']; ?>">
                        <?php echo $row['title']; ?>
                      </a>
                      中回答：
                    </p>
                    <div class="home-dacontent">
                      <?php echo htmlspecialchars_decode($row['content']); ?>
                    </div>
                  </li>
                <?php endforeach; ?>
            <?php  } ?>
          </ul>
        </div>
      </div>
    </div>
    

</div>
    <div class="footer">
      <p>
        <a href="http://fly.layui.com/">
          Fly社区
        </a>
        2017 &copy;
        <a href="http://www.layui.com/">
          layui.com
        </a>
      </p>
      <p>
        <a href="http://fly.layui.com/jie/3147.html" target="_blank">
          产品授权
        </a>
        <a href="http://fly.layui.com/jie/8157.html" target="_blank">
          获取Fly社区模版
        </a>
        <a href="http://fly.layui.com/jie/2461.html" target="_blank">
          微信公众号
        </a>
      </p>
    </div>

    
  </body>
	<script type="text/javascript">
		layui.use(['layer', 'form','element'], function(){
		  var layer = layui.layer
		  ,form = layui.form();
		   $ = layui.jquery;
		  /*form.on('submit(login)', function(data){
				$.ajax({
				url:'<?php echo U("home/login/checkdata");?>',
					type: 'POST',
					dataType: 'json',
					data: data.field,
				})
				.done(function(respones) {
					if(respones.error==1){
                        layer.msg(respones.info,function (){

                     })
					}else{
                        layer.alert('登录成功',{icon:6},function (){
                            location.href='<?php echo U("home/user/index");?>';
                        });
                    }
				})
				.fail(function() {
					console.log("error");
				});

				return false;
		   });*/
		 
		
		});
	</script>
</html>